<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>后盾问答</title>
	<meta name="keywords" content="后盾问答"/>
	<meta name="description" content="后盾问答"/>
	<link rel="stylesheet" href="/wenda/Public/Home/Css/common.css" />
	<script type="text/javascript" src='/wenda/Public/Home/Js/jquery-1.7.2.min.js'></script>
	<script type="text/javascript" src='/wenda/Public/Home/Js/top-bar.js'></script>
	<link rel="stylesheet" href="/wenda/Public/Home/Css/list.css" />
</head>
<body>
	<!-- top -->
		<div id='top-fixed'>
	<div id='top-bar'>
		<ul class="top-bar-left fl">
			<li><a href="" target='_blank'>360搜索</a></li>
			<li><a href="" target='_blank'>360官方网站</a></li>
		</ul>
		<ul class='top-bar-right fr'>
			<?php if(isset($_SESSION['username']) && isset($_SESSION['uid'])): ?><li class='userinfo'>
					<a href="<?php echo U('Member/index',array('uid'=>$_SESSION['uid']));?>" class='uname'><?php echo (session('username')); ?></a>
				</li>
				<li style='color:#eaeaf1'>|</li>
				<li><a href="<?php echo U('Login/out');?>">退出</a></li> 
			<?php else: ?>
				<li><a href="" class='login'>登录</a></li>
				<li style='color:#eaeaf1'>|</li>
				<li><a href="" class='register'>注册</a></li><?php endif; ?>
		</ul>
	</div>
<!-- 提问搜索框 -->
	<div id='search'>
		<div class='logo'><a href="<?php echo U('Index/index');?>" class='logo'></a></div>
		<form action="<?php echo U('Search/index');?>" method='get'>
			<input type="text" name='search' class='sech-cons'/>
			<input type="submit" class='sech-btn'/>
		</form>
		<a href="<?php echo U('Ask/index');?>" class='ask-btn'></a>
	</div>
<!-- 提问搜索框结束 -->
</div>
<div style='height:110px'></div>
<!----------导航条---------->
<div id='nav'>
	<ul class='list'>
		<li class='nav-sel'><a href="<?php echo U('Index/index');?>" class='home'>问答首页</a></li>
		<li class='nav-sel ask-cate'>
			<a href="" class='ask-list'><span>问题库</span><i></i></a>
			<ul class='hidden'>
				<?php if(is_array($topCate)): $i = 0; $__LIST__ = $topCate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>
					<a href="<?php echo U('List/index',array('cid'=>$vo['cid'],'where'=>0));?>"><?php echo ($vo["cname"]); ?></a>
				</li><?php endforeach; endif; else: echo "" ;endif; ?>
			</ul>
		</li>
	</ul>
	<p class='total'>累计提问：<?php echo ($askNum); ?></p>
</div>

	<!----------注册框---------->
	<div id='register' class='hidden'>
		<div class='reg-title'>
			<p>欢迎注册后盾问答</p>
			<a href="" title='关闭' class='close-window'></a>
		</div>
		<div id='reg-wrap'>
			<div class='reg-left'>
				<ul>
					<li><span>账号注册</span></li>
				</ul>
				<div class='reg-l-bottom'>
					已有账号，<a href="" id='login-now'>马上登录</a>
				</div>
			</div>
			<div class='reg-right'>
				<form action="<?php echo U('Reg/index');?>" method='post' id='reg' name='register'>
					<ul>
						<li>
							<label for="reg-uname">用户名</label>
							<input type="text" name='username' id='reg-uname' ajaxurl="<?php echo U('Reg/check_user');?>" datatype="s2-14" nullmsg="请填写2-14个字符：字母、数字或中文" errormsg="请填写2-14个字符：字母、数字或中文" sucmsg='验证通过' />
							<span class="Validform_checktip">2-14个字符：字母、数字或中文</span>
						</li>
						<li>
							<label for="reg-pwd">密码</label>
							<input type="password" name='password' id='reg-pwd' datatype="s2-14" nullmsg="请填写6-20个字符:字母、数字或下划线 _" errormsg="请填写6-20个字符:字母、数字或下划线 _" sucmsg='验证通过' />
							<span class="Validform_checktip">6-20个字符:字母、数字或下划线 _</span>
						</li>
						<li>
							<label for="reg-pwded">确认密码</label>
							<input type="password" name='pwded' id='reg-pwded' datatype="*"  recheck="password" nullmsg="请再输入一次密码！" errormsg="您两次输入的账号密码不一致！"  sucmsg='验证通过' />
							<span class="Validform_checktip">请再输入一次密码</span>
						</li>
						<li>
							<label for="reg-verify">验证码</label>
							<input type="text" name='verify' id='reg-verify' ajaxurl="<?php echo U('Reg/check_verify');?>"  datatype="*" nullmsg="请输入验证码" errormsg="验证码不正确"  sucmsg='验证通过' />
							<img src="<?php echo U('Reg/code');?>" width='99' height='35' alt="验证码" id='verify-img' onclick="this.src=this.src+'?'+Math.random()"  />
							<span class="Validform_checktip">请输入图中的字母或数字，不区分大小写</span>
						</li>
						<li class='submit'>
							<input type="submit" value='立即注册'/>
						</li>
					</ul>
				</form>
			</div>
		</div>
	</div>

	<!----------登录框---------->	
	<div id='login' class='hidden'>
		<div class='login-title'>
			<p>欢迎您登录后盾问答</p>
			<a href="" title='关闭' class='close-window'></a>
		</div>
		<div class='login-form'>
			<span id='login-msg' style="background: none;"></span>
			<!-- 登录FORM -->
			<form id='logincon' action="<?php echo U('Login/index');?>" method='post' name='login'>
				<ul>
					<li>
						<label for="login-acc">账号</label>
						<input type="text" name='account' class='input' id='login-acc' ajaxurl="<?php echo U('Login/check_user');?>" datatype="s2-14" nullmsg="请填写2-14个字符：字母、数字或中文" errormsg="请填写2-14个字符：字母、数字或中文" sucmsg='' />
					</li>
					<li>
						<label for="login-pwd">密码</label>
						<input type="password" name='password' class='input' id='login-pwd' datatype="s2-14" nullmsg="请填写6-20个字符:字母、数字或下划线 _" errormsg="请填写6-20个字符:字母、数字或下划线 _" />
					</li>
					<li class='login-auto'>
						<label for="auto-login">
							<input type="checkbox" checked='checked' name='auto'  id='auto-login'/>&nbsp;下一次自动登录
						</label>
						<a href="" id='regis-now'>注册新账号</a>
					</li>
					<li>
						<input type="submit" value='' id='login-btn'/>
					</li>
				</ul>
			</form>
		</div>
	</div>

<!--背景遮罩--><div id='background' class='hidden'></div>
	<!-- top 结束-->
	<div id='location'>
		<a href="<?php echo U('List/index',array('cid'=>0,'where'=>0));?>">全部分类</a>
		<?php if(is_array($mbx)): $k = 0; $__LIST__ = $mbx;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k; if($k==count($mbx)): ?>&gt;&nbsp;<?php echo ($vo["cname"]); ?>&nbsp;&nbsp;
			<?php else: ?>
				&gt;&nbsp;<a href="<?php echo U('List/index',array('cid'=>$vo['cid'],'where'=>0));?>"><?php echo ($vo["cname"]); ?></a>&nbsp;&nbsp;<?php endif; endforeach; endif; else: echo "" ;endif; ?>	
	</div>

<!--------------------中部-------------------->
	<div id='center'>
		<div id='left'>
			<div id='cate-list'>
				<p class='title'>按分类查找</p>
				<ul>
					<?php if(is_array($cateDB)): $i = 0; $__LIST__ = $cateDB;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li>
							<?php if($_GET['cid']== $vo['cid']): echo ($vo["cname"]); ?>
							<?php else: ?>
								<a href="<?php echo U('List/index',array('cid'=>$vo['cid'],'where'=>0));?>"><?php echo ($vo["cname"]); ?></a><?php endif; ?>
						</li><?php endforeach; endif; else: echo "" ;endif; ?>
				</ul>
			</div>
			<div id='answer-list'>
				<ul class='ans-sel'>
					<li <?php if($_GET['where']== 0): ?>class='on'<?php endif; ?>>
						<a href="<?php echo U('List/Index',array('cid'=>$cateCid,'where'=>0));?>">待解决问题</a>
					</li>
					<li <?php if($_GET['where']== 1): ?>class='on'<?php endif; ?>>
						<a href="<?php echo U('List/Index',array('cid'=>$cateCid,'where'=>1));?>">已解决</a>
					</li>
					<li <?php if($_GET['where']== 2): ?>class='on'<?php endif; ?>>
						<a href="<?php echo U('List/Index',array('cid'=>$cateCid,'where'=>2));?>">高悬赏</a>
					</li>
					<li <?php if($_GET['where']== 3): ?>class='on'<?php endif; ?>>
						<a href="<?php echo U('List/Index',array('cid'=>$cateCid,'where'=>3));?>">零回答</a>
					</li>
				</ul>
				<!-- 待解决问题 -->
				<table>
					<tr>
						<th class='t1'>标题</th>
						<th>回答数</th>
						<th>时间</th>
					</tr>
					<?php if(is_array($solving)): $i = 0; $__LIST__ = $solving;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
							<td class='t1 cons'>
								<a href="<?php echo U('Show/index',array('asid'=>$vo['asid'],'cid'=>$cateCid));?>">
									<b><?php echo ($vo["gold"]); ?></b><?php echo ($vo["content"]); ?></a>&nbsp;&nbsp;[<?php echo ($vo["cname"]); ?>]
							</td>
							<td><?php echo ($vo["answer"]); ?></td>
							<td><?php echo (date('Y-m-d H:i:s',$vo["time"])); ?></td>
						</tr><?php endforeach; endif; else: echo "$empty" ;endif; ?>
					<tr class='page'>
						<td colspan='3'>
							<?php echo ($page); ?>
						</td>
					</tr>
				</table>

			</div>
		</div>

		<!-- 右侧 -->
		<div id='right'>
	<?php if(isset($_SESSION['username']) && isset($_SESSION['uid'])): ?><div class='userinfo'>
			<dl>
				<dt>
					<a href="<?php echo U('Member/index',array('uid'=>$loginUser['uid']));?>"><img src="<?php echo ($loginUser["face"]); ?>" width='48' height='48' alt="占位符"/></a>
				</dt>
				<dd class='username'>
					<a href="<?php echo U('Member/index',array('uid'=>$loginUser['uid']));?>"><?php echo (session('username')); ?>
						<b></b>
					</a>
					<a href="<?php echo U('Member/index',array('uid'=>$loginUser['uid']));?>">
						<i class='level lv<?php echo ($loginUser["level"]); ?>' title='Level <?php echo ($loginUser["level"]); ?>'></i>
					</a>
				</dd>
				<dd>金币：<a href="<?php echo U('Member/index',array('uid'=>$loginUser['uid']));?>" style="color: #888888;"><?php echo ($loginUser["gold"]); ?><b class='point'></b></a></dd>
				<dd>经验值：<?php echo ($loginUser["exp"]); ?></dd>
			</dl>
			<table>
				<tr>
					<td>回答数</td>
					<td>采纳率</td>
					<td class='last'>提问数</td>
				</tr>
				<tr>
					<td><a href=""><?php echo ($loginUser["answer"]); ?></a></td>
					<td><a href=""><?php echo ($loginUser["adoptBfb"]); ?>%</a></td>
					<td class='last'><a href=""><?php echo ($loginUser["ask"]); ?></a></td>
				</tr>
			</table>
			<ul>
				<li><a href="<?php echo U('Member/my_ask',array('uid'=>$loginUser['uid']));?>">我提问的</a></li>
				<li><a href="<?php echo U('Member/my_answer',array('uid'=>$loginUser['uid']));?>">我回答的</a></li>
			</ul>
		</div>
	<?php else: ?>		
		 <div class='r-login'>
			<span class='login'><i></i>&nbsp;登录</span>
			<span class='register'><i></i>&nbsp;注册</span>
		</div><?php endif; ?>		
	<div class='clear'></div>
	<div class='star'>
		<p class='title'>后盾问答之星</p>
		<span class='star-name'>本日回答问题最多的人</span>
			<?php if(is_array($mostToday)): $i = 0; $__LIST__ = $mostToday;if( count($__LIST__)==0 ) : echo "无" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class='star-info'>
				<div>
					<a href="<?php echo U('Member/index',array('uid'=>$vo['uid']));?>" class='star-face'>
						<img src="<?php echo ($vo["face"]); ?>" width='48px' height='48px' alt="头像站位"/>
					</a>
					<ul>
						<li><a href="<?php echo U('Member/index',array('uid'=>$vo['uid']));?>"><?php echo ($vo["username"]); ?></a></li>
						<i class='level lv<?php echo ($vo["level"]); ?>' title='Level <?php echo ($vo["level"]); ?>'></i>
					</ul>
				</div>
				<ul class='star-count'>
					<li>回答数：<span><?php echo ($vo["uanswer"]); ?></span></li>
					<li>采纳率：<span><?php echo ($vo["adoptBfb"]); ?>%</span></li>
				</ul>
			</div><?php endforeach; endif; else: echo "无" ;endif; ?>
		<span class='star-name'>历史回答问题最多的人</span>

		<div class='star-info'>
			<div>
				<a href="<?php echo U('Member/index',array('uid'=>$mostAnswer['uid']));?>" class='star-face'>
					<img src="<?php echo ($mostAnswer["face"]); ?>" width='48px' height='48px' alt="头像站位"/>
				</a>
				<ul>
					<li><a href="<?php echo U('Member/index',array('uid'=>$mostAnswer['uid']));?>"><?php echo ($mostAnswer["username"]); ?></a></li>
					<i class='level lv<?php echo ($mostAnswer["level"]); ?>' title='Level <?php echo ($mostAnswer["level"]); ?>'></i>
				</ul>
			</div>
			<ul class='star-count'>
				<li>回答数：<span><?php echo ($mostAnswer["answer"]); ?></span></li>
				<li>采纳率：<span><?php echo ($mostAnswer["adoptBfb"]); ?>%</span></li>
			</ul>
		</div>
	</div>
	<div class='star-list'>
		<p class='title'>后盾问答助人光荣榜</p>
		<div>
			<ul class='ul-title'>
				<li>用户名</li>
				<li style='text-align:right;'>帮助过的人数</li>
			</ul>
			<ul class='ul-list'>
				<?php if(is_array($honor)): $k = 0; $__LIST__ = $honor;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><li>
						<a href="<?php echo U('Member/index',array('uid'=>$vo['uid']));?>"><i class='rank r<?php echo ($k); ?>'></i><?php echo ($vo["username"]); ?></a>
						<span><?php echo ($vo["adopt"]); ?></span>
					</li><?php endforeach; endif; else: echo "" ;endif; ?>	
			</ul>
		</div>
	</div>
</div>
		<!-- ---右侧结束---- -->
	</div>
<!--------------------中部结束-------------------->

<!-- 底部 -->
	<div id='bottom'>
		<p><?php echo (C("COPY")); ?></p>
		<p><?php echo (C("RECORD")); ?></p>
	</div>
<!--[if IE 6]>
    <script type="text/javascript" src="/wenda/Public/Home/Js/iepng.js"></script>
    <script type="text/javascript">
    	DD_belatedPNG.fix('.logo','background');
        DD_belatedPNG.fix('.nav-sel a','background');
        DD_belatedPNG.fix('.ask-cate i','background');
    </script>
<![endif]-->
</body>
</html>
<!-- 底部结束 -->